package com.faker.dba.util;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Toolkit {
    /**
     * 时间格式化
     */
    public static SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    /**
     * 获取字符串
     *
     * @param object 对象
     * @return
     */
    public static String getString(Object object) {
        if (null == object) {
            return "";
        } else {
            if (object instanceof Date) {
                return sdf1.format((Date) object);
            } else if (object instanceof java.sql.Date) {
                return sdf1.format((java.sql.Date) object);
            } else {
                return String.valueOf(object);
            }
        }
    }
}
